import com.sun.jdi.connect.Connector;

import java.text.DecimalFormat;

public class BankAccout {
        //成员变量
        private static int accoutNum=1000;//账号
        private double balance;//余额
        //getter、setter 方法
        public void setAccoutNum(double balance){//修改账号
           accoutNum++;
           balance=0.0;
       }
        //public String getAccoutNum(){//获取账号
          //  return accoutNum;
        //}
        public void setBalance(double balance){//修改余额
            this.balance = balance;
        }
        public double getBalance(){//获取余额
            return balance;
        }
        public void deposit(double money){//存款方法
            balance = balance + money;
        }
        public void withdraw(double money){//取款方法
            balance = balance - money;
        }
        public String toString(){
            return "accoutNumber:"+accoutNum+"balance"+
                    new DecimalFormat("0.0").format(balance);
        }
}



